package com.caiheng.api.service.product;

import com.caiheng.api.entity.mer.Mer;
import com.caiheng.api.entity.product.Product;
import com.caiheng.api.entity.product.ProductAttrValue;
import com.caiheng.api.entity.product.ProductOrder;
import com.caiheng.api.entity.product.ProductOrderInfo;
import com.caiheng.api.entity.wxuser.User;
import com.caiheng.api.service.base.BaseService;

import java.util.List;
import java.util.Map;

public interface ProductOrderInfoService extends BaseService<ProductOrderInfo> {

    ProductOrderInfo selectOneByOrderId(Long order_id);

    List<ProductOrderInfo> selectListByOrderId(Mer mer, Long order_id);

    /**
     *  获取核销二维码
     * @param info_id
     * @return
     */
    ProductOrderInfo getInfoQrCode(Long info_id,int reset_qr_code);

    /**
     *  删除详情
     * @param infoId
     * @return
     */
    int deleteInfo(Long infoId);


    /**
     *  添加订单明细
     * @param order
     * @param product
     * @param attrValue
     * @param count
     * @return
     */
    Map<String,Object> addInfo(User user, ProductOrder order, Product product, ProductAttrValue attrValue, int count);


    /**
     *  修改订单明细
     * @param orderInfo
     * @param count
     * @return
     */
    Map<String,Object> updateInfo(ProductOrder order, ProductOrderInfo orderInfo, int count);

}
